﻿fn main() {
    let x = Box::new(5); // Allocate an integer on the heap
    println!("The value is: {}", x);
}



// A simple recursive data structure using Box
struct List {
    value: i32,
    next: Option<Box<List>>,
}
fn main() {
    let list = List {
        value: 1,
        next: Some(Box::new(List {
            value: 2,
            next: None,
        })),
    };
    println!("First value: {}", list.value);
}

